/**
 * URL ENCODER
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this page.
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please contact twitter
 * to @agniuek so we can send you a copy immediately.
 *  
 * @category   javascript
 * @package    js here
 * @copyright  Copyright (c) 2012 agniuek
 * @license    New BSD License
 */

var Encoder = {};

Encoder.encode_uri = function() {
	var encode_result = encodeURI(document.getElementById('to_convert').value);
	if ((encode_result == null) || (encode_result == "")) {
		return;
	}
	document.getElementById('to_decode').innerHTML = encode_result;
}

Encoder.decode_uri = function() {
	var decode_uri = decodeURI(document.getElementById('to_convert').value);
	if ((decode_uri == null) || (decode_uri == "")) {
		return;
	}
	var decode_result = decode_uri.replace(/</g, "&lt;");
	document.getElementById("to_decode").innerHTML = decode_result;
}
